<%--
  Created by IntelliJ IDEA.
  User: 陌·笙
  Date: 2019-01-12
  Time: 20:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查看退货信息</title>
    <jsp:include page="/comm/tag.jsp"></jsp:include>
    <script>
        $(function () {
            $("#detail").bootstrapTable({
                url:"/tuihuo/shows",
                height:750,
                pageSize:25,
                pageNumber:1,
                //启用分页，但是默认情况下，是客户端分页的
                pagination:true,
                sidePagination:'server',
                queryParams:function(params){
                    var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                        limit: params.limit,  //页面大小
                        offset: params.offset, //页码
                        seat:$("[name='seat']").val(),
                    };
                    return temp;
                },
                locale:'zh-CN',//中文支持,
                toolbar:'#top',
                columns:[
                    {field:"seat",title:"单号",align:"center"},
                    {field:"repertory.repertoryName",title:"商品名称",align:"center"},
                    {field:"repertory.model",title:"手机类型",align:"center"},
                    {field:"repertory.repertoryColor",title:"颜色",align:"center"},
                    {field:"repertory.presetPrice",title:"单价",align:"center"},
                    {field:"totalPrice",title:"总价格",align:"center"},
                    {field:"th",title:"状态",align:"center"},
                    {field:"retreatTime",title:"退货时间",align:"center"},
                    {field:"retreatNum",title:"退货数量",align:"center"},
                    {field:"retreatRemark",title:"备注",align:"center"},
                ]
            })
        })
        function cha(){
            var opts = $("#detail").bootstrapTable("getOptions");
            var seat=$("[name='seat']").val();
            var repertoryName=$("[name='repertoryName']").val();
            var limit = opts.pageSize;
            var offset = (opts.pageNumber-1) * limit;
            $.ajax({
                url:"/tuihuo/shows",
                type:"get",
                data:{"seat":seat,"repertoryName":repertoryName,'limit':limit,'offset':offset},
                success:function(data){
                    $("#detail").bootstrapTable("load",data);
                }
            })
        }
    </script>
</head>
<body>
<div style="margin-left: 50px;margin-right: 50px">
    <div class="#top" style="margin-top: 30px">
        <div class="col-md-12">
            <form action="" method="post" role="form" class="form-horizontal">

                <div class="col-md-1 pull-right">
                    <button type="button" class="btn btn-primary btn-info glyphicon glyphicon-search" onclick="cha()">查询</button>
                </div>
                <div class="form-group col-md-4 pull-right">
                    <label for="" class="col-md-4 control-label">商品名称:</label>
                    <div class="col-md-8">
                        <input type="text" class="form-control" name="repertoryName" placeholder="可模糊查询">
                    </div>
                </div>
                <div class="form-group col-md-4 pull-right">
                    <label for="" class="col-md-4 control-label">单号查询:</label>
                    <div class="col-md-8">
                        <input type="text" class="form-control" name="seat" placeholder="可模糊查询">
                    </div>
                </div>
            </form>
        </div><%--搜索框--%>
    </div>
    <table id="detail" class="table-striped"></table>
</div>
</body>
</html>
